/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2022-07-20
 * Time:11:05
 */
public class TestDemo {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("前序遍历");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("中序遍历");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("后序遍历");
        //binaryTree.postOrder(root);
        System.out.println();
        System.out.println("节点的个数1："+ binaryTree.size(root));
        binaryTree.size2(root);
        System.out.println("节点的个数2："+ BinaryTree.nodeSize);
        System.out.println("===============");
        System.out.println("叶子节点个数1："+binaryTree.getLeafNodeCount(root));
        binaryTree.getLeafNodeCount2(root);
        System.out.println("叶子节点个数2："+BinaryTree.leafsize);
        System.out.println("第K层节点的个数："+binaryTree.getKLevelNodeCount(root,4));
        System.out.println("高度："+binaryTree.getHeight(root));
        System.out.println("层序遍历:");
        binaryTree.levelOrder(root);
    }

}
